﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.controllers.popups {
    import net.wooga.pets.loading.vos.*;
    import net.wooga.pets.events.*;
    import net.wooga.pets.models.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;

    public class GiftRequestSuccessCommand extends Command {

        public var event:InfoEvent;
        public var session:SessionModel;

        override public function execute():void{
            var _local5:InfoEvent;
            var _local1:Array = (this.event.info as Array);
            var _local2:Object = _local1[0];
            var _local3:String = _local2.type;
            var _local4:Boolean = _local2.gift;
            l((((" GIFT SUCCESS type " + _local3) + " isGift ") + _local4));
            if (_local4){
                this.sendTaskRequest(_local3);
            } else {
                _local5 = new InfoEvent(EventConstants.UPDATE_ASK_FOR_GIFT_BUTTON, null, _local2);
                dispatch(_local5);
            };
        }
        private function sendTaskRequest(_arg1:String):void{
            var _local2:Object = {taskType:GameConstants.SEND_A_GIFT, itemType:_arg1, onResult:this.onResult};
            var _local3:Array = [new RequestVO("sendGift", {id:this.event.id})];
            var _local4:TaskRequestEvent = new TaskRequestEvent(EventConstants.SEND_TASK_REQUEST, _local3, _local2);
            dispatch(_local4);
        }
        private function onResult(_arg1:ResultVO):void{
            if (_arg1.success){
            };
        }

    }
}//package net.wooga.pets.controllers.popups 
